import numpy as np

x_train = np.random.random((100, 4, 8))
y_train = np.random.random((100, 10))

x_val = np.random.random((100, 4, 8))
y_val = np.random.random((100, 10))

from keras.models import Sequential

model = Sequential()

from keras.layers import LSTM, Dense

# add a sequence of vectors of dimension 16
model.add(LSTM(16, return_sequences=True))
model.add(Dense(10, activation='softmax'))

model.compile(
    loss='categorical_crossentropy', optimizer='sgd', metrics=['accuracy']
)

model.fit(x_train, y_train, batch_size=32, epochs=5, validation_data=(x_val, y_val))
